home *** CD-ROM | disk | FTP | other *** search
/ Enter 2004 January / enter-2004-01.iso / files / maxima-5.9.0.exe / {app} / share / maxima / 5.9.0 / src / numerical / slatec / dbesi1.lisp < prev    next >
Encoding:
Text File  |  2003-02-09  |  3.0 KB  |  71 lines

  1. ;;; Compiled by f2cl version 2.0 beta 2002-05-06
  2. ;;; 
  3. ;;; Options: ((:prune-labels nil) (:auto-save t) (:relaxed-array-decls t)
  4. ;;;           (:coerce-assigns :as-needed) (:array-type ':simple-array)
  5. ;;;           (:array-slicing nil) (:declare-common nil)
  6. ;;;           (:float-format double-float))
  7.  
  8. (in-package "SLATEC")
  9.  
  10.  
  11. (let ((nti1 0)
  12.       (xmin 0.0)
  13.       (xsml 0.0)
  14.       (xmax 0.0)
  15.       (bi1cs (make-array 17 :element-type 'double-float))
  16.       (first nil))
  17.   (declare (type f2cl-lib:logical first)
  18.            (type (simple-array double-float (17)) bi1cs)
  19.            (type double-float xmax xsml xmin)
  20.            (type f2cl-lib:integer4 nti1))
  21.   (f2cl-lib:fset (f2cl-lib:fref bi1cs (1) ((1 17))) -0.0019717132610998596)
  22.   (f2cl-lib:fset (f2cl-lib:fref bi1cs (2) ((1 17))) 0.4073488766754648)
  23.   (f2cl-lib:fset (f2cl-lib:fref bi1cs (3) ((1 17))) 0.03483899429995946)
  24.   (f2cl-lib:fset (f2cl-lib:fref bi1cs (4) ((1 17))) 0.0015453945563001237)
  25.   (f2cl-lib:fset (f2cl-lib:fref bi1cs (5) ((1 17))) 4.188852109837779e-5)
  26.   (f2cl-lib:fset (f2cl-lib:fref bi1cs (6) ((1 17))) 7.649026764836211e-7)
  27.   (f2cl-lib:fset (f2cl-lib:fref bi1cs (7) ((1 17))) 1.0042493924741178e-8)
  28.   (f2cl-lib:fset (f2cl-lib:fref bi1cs (8) ((1 17))) 9.932207791923812e-11)
  29.   (f2cl-lib:fset (f2cl-lib:fref bi1cs (9) ((1 17))) 7.663801791844763e-13)
  30.   (f2cl-lib:fset (f2cl-lib:fref bi1cs (10) ((1 17))) 4.741418923816739e-15)
  31.   (f2cl-lib:fset (f2cl-lib:fref bi1cs (11) ((1 17))) 2.4041144040745183e-17)
  32.   (f2cl-lib:fset (f2cl-lib:fref bi1cs (12) ((1 17))) 1.0171505007093713e-19)
  33.   (f2cl-lib:fset (f2cl-lib:fref bi1cs (13) ((1 17))) 3.645093565786695e-22)
  34.   (f2cl-lib:fset (f2cl-lib:fref bi1cs (14) ((1 17))) 1.1205749502562039e-24)
  35.   (f2cl-lib:fset (f2cl-lib:fref bi1cs (15) ((1 17))) 2.987544193446809e-27)
  36.   (f2cl-lib:fset (f2cl-lib:fref bi1cs (16) ((1 17))) 6.973231093919469e-30)
  37.   (f2cl-lib:fset (f2cl-lib:fref bi1cs (17) ((1 17))) 1.43679482206208e-32)
  38.   (setq first f2cl-lib:%true%)
  39.   (defun dbesi1 (x)
  40.     (declare (type double-float x))
  41.     (prog ((y 0.0) (dbesi1 0.0))
  42.       (declare (type double-float dbesi1 y))
  43.       (cond
  44.        (first
  45.         (setf nti1
  46.                 (initds bi1cs 17
  47.                  (* 0.1f0 (f2cl-lib:freal (f2cl-lib:d1mach 3)))))
  48.         (setf xmin (* 2.0 (f2cl-lib:d1mach 1)))
  49.         (setf xsml (f2cl-lib:fsqrt (* 4.5 (f2cl-lib:d1mach 3))))
  50.         (setf xmax (f2cl-lib:flog (f2cl-lib:d1mach 2)))))
  51.       (setf first f2cl-lib:%false%)
  52.       (setf y (coerce (abs x) 'double-float))
  53.       (if (> y 3.0) (go label20))
  54.       (setf dbesi1 0.0)
  55.       (if (= y 0.0) (go end_label))
  56.       (if (<= y xmin)
  57.           (xermsg "SLATEC" "DBESI1" "ABS(X) SO SMALL I1 UNDERFLOWS" 1 1))
  58.       (if (> y xmin) (setf dbesi1 (* 0.5 x)))
  59.       (if (> y xsml)
  60.           (setf dbesi1
  61.                   (* x (+ 0.875 (dcsevl (- (/ (* y y) 4.5) 1.0) bi1cs nti1)))))
  62.       (go end_label)
  63.      label20
  64.       (if (> y xmax)
  65.           (xermsg "SLATEC" "DBESI1" "ABS(X) SO BIG I1 OVERFLOWS" 2 2))
  66.       (setf dbesi1 (* (exp y) (dbsi1e x)))
  67.       (go end_label)
  68.      end_label
  69.       (return (values dbesi1 nil)))))
  70.  
  71.